from base.base_api import Base
from ele_loctor.wms_loctor import *
from time import sleep
import allure
@allure.feature("测试仓储")
class WMSPage(Base):
    @allure.step("输入账号:{text}")
    def input_user(self,text):
        self.input_text(*user,text)
    @allure.step("输入密码：{text}")
    def input_pwd(self,text):
        self.input_text(*pwd,text)
    @allure.step("点击登录按钮")
    def click_btn(self):
        self.click_ele(*login_btn)
        sleep(4)        # 等待页面跳转
    @allure.step("点击弹窗关闭")
    def click_tanchuang(self):
        self.click_ele(*tan_btn)
    @allure.step("点击审批流程")
    def click_shen(self):
        self.click_eles(*shenpi_btn,21)
    @allure.step("点击审批演示")
    def click_show(self):
        self.click_ele(*show_btn)
        sleep(2)        # 进入tap页面
    @allure.step("点击新建")
    def click_add(self):
        self.click_eles(*add_btn,37)
    @allure.step("输入审批名称：{text}")
    def input_names(self,text):
        self.win_(-1)
        sleep(5) # 等待新建审批弹窗弹出
        self.input_texts(*input_name,5,text)
    @allure.step("点击保存按钮")
    def click_save(self):
        sleep(3)
        self.click_ele(*save_btn)
